n = int(input())
my_list = []
for i in range(100,1000) :

    if sum(map(int,str(i) + str(i)[::-1])) == n :
        my_list.append(str(i) + str(i)[::-1])
        
    if sum(map(int,str(i) + str(i)[:2][::-1])) == n :
        my_list.append(str(i) + str(i)[:2][::-1])
for i in sorted(map(int,my_list)) : 
    print(i)